package com.sky.financelake.bean.dto;

import android.os.Parcel;
import android.os.Parcelable;

public class CommunityDto implements Parcelable {

    public CommunityDto() {
    }

    public Integer id;
    public String tag;
    public String title;
    public String username;
    public String cover;
    public String original;
    public Integer createTime;


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeValue(this.id);
        dest.writeString(this.tag);
        dest.writeString(this.title);
        dest.writeString(this.username);
        dest.writeString(this.cover);
        dest.writeString(this.original);
        dest.writeValue(this.createTime);
    }

    public void readFromParcel(Parcel source) {
        this.id = (Integer) source.readValue(Integer.class.getClassLoader());
        this.tag = source.readString();
        this.title = source.readString();
        this.username = source.readString();
        this.cover = source.readString();
        this.original = source.readString();
        this.createTime = (Integer) source.readValue(Integer.class.getClassLoader());
    }

    protected CommunityDto(Parcel in) {
        this.id = (Integer) in.readValue(Integer.class.getClassLoader());
        this.tag = in.readString();
        this.title = in.readString();
        this.username = in.readString();
        this.cover = in.readString();
        this.original = in.readString();
        this.createTime = (Integer) in.readValue(Integer.class.getClassLoader());
    }

    public static final Creator<CommunityDto> CREATOR = new Creator<CommunityDto>() {
        @Override
        public CommunityDto createFromParcel(Parcel source) {
            return new CommunityDto(source);
        }

        @Override
        public CommunityDto[] newArray(int size) {
            return new CommunityDto[size];
        }
    };
}
